{template 'web/_header'}
<ul class="nav nav-tabs">
    <li class=""><a href="{php echo $this->createPluginWebUrl('express/express')}">快递预处理</a></li>
    <li class="active"><a href="{php echo $this->createPluginWebUrl('express/courier', array('op' => 'lists', 'expressid' => $_GPC['expressid']))}">快递单号管理</a></li>
    <li class=""><a href="{php echo $this->createPluginWebUrl('express/shipment')}">批量发货</a></li>
</ul>

<form method="post" class="form-horizontal form">
    <input type="hidden" name="courier[expressid]" value="{$_GPC['expressid']}" />
    <input type="hidden" name="courier[id]" value="{$_GPC['id']}" />

    <div class='panel panel-default'>
        <div class='panel-heading'>
            快递物流单号池
        </div>
        <div class='panel-body'>

            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label" for="identification"> 单号标识</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" id="identification" name="courier[identification]" class="form-control" value="{$courier['identification']}" />
                    <span class="help-block">标识即快递单号中，非数字部分。若单号为纯数字则留空。</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label" for="start_number"><span style='color:red'>*</span> 起始单号</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" id="start_number" name="courier[start_number]" class="form-control" value="{$courier['start_number']}" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label" for="end_number"><span style='color:red'>*</span> 结束单号</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" id="end_number" name="courier[end_number]" class="form-control" value="{$courier['end_number']}" />
                </div>
            </div>

        </div>

        <div class="panel-footer" style="overflow: auto;">
            <div class="form-group col-sm-12">
                <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
                <input type="hidden" name="token" value="{$_W['token']}" />
            </div>
        </div>

    </div>

</form>


<script type="text/javascript">
    $('.form').submit(function(){

        var start_numberObj = $("input[name='courier[start_number]']");

        var startNumber = parseInt(start_numberObj.val());

        if(isNaN(startNumber)){
            Tip.focus(start_numberObj,'请输入起始单号!');
            return false;
        }

        var end_numberObj = $("input[name='courier[end_number]']");

        var endNumber = parseInt(end_numberObj.val());

        if(isNaN(endNumber)){
            Tip.focus(end_numberObj,'请输入结束单号!');
            return false;
        }

        if(startNumber >= endNumber){
            Tip.focus(end_numberObj,'结束单号不能小于开始单号!');
            return false;
        }

        return true;
    });

</script>

{template 'common/footer'}